<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <script>
        //首先熟悉js的creatElement的方法
        let app = document.getElementById('app');
        let h1 = document.createElement('h1');
        let content = '这是H1';
        app.appendChild(h1);
        document.getElementsByTagName('h1')[0].append(content);
    </script>
</body>
</html>